//
//  LeftViewController.m
//  DuBai
//
//  Created by darktm on 14-2-20.
//  Copyright (c) 2014年 darktm. All rights reserved.
//

#import "PersonalCenterViewController.h"

#import "PersonalCenterViewCell.h"

#import "MyScoreViewController.h"
#import "MyOrderViewController.h"
#import "RcvAdressViewController.h"
#import "PersonalInfoViewController.h"
#import "FavouriteViewController.h"


@interface PersonalCenterViewController ()

@end

@implementation PersonalCenterViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    
//    [self setExtraCellLineHidden:self.tableView];
    
    self.setting.layer.cornerRadius = 13.0f;
    self.setting.layer.masksToBounds = YES;
    
}

#pragma mark - tableview delegate -

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
    UIView *view =[[UIView alloc]init];
    view.backgroundColor = [UIColor clearColor];
    return view;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 5;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    PersonalCenterViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PersonalCenterViewCell" forIndexPath:indexPath];
    
    cell.selectionStyle = UITableViewCellSelectionStyleNone;

    cell.tips.layer.cornerRadius = 9.0f;
    cell.tips.layer.masksToBounds = YES;
    
    switch (indexPath.row) {
        case 0:
            //我的积分
            cell.title.text = @"我的积分";
            cell.image.image = [UIImage imageNamed:@"personal_img_score.png"];
            break;
        case 1:
            //个人信息
            cell.title.text = @"个人信息";
            cell.image.image = [UIImage imageNamed:@"personal_img_personal_info.png"];
            break;
        case 2:
            //我的订单
            cell.title.text = @"我的订单";
            cell.image.image = [UIImage imageNamed:@"personal_img_order.png"];
            break;
        case 3:
            cell.title.text = @"我的关注";
            cell.image.image = [UIImage imageNamed:@"personal_img_favourite.png"];
            break;
        case 4:
            //收货地址
            cell.title.text = @"收货地址";
            cell.image.image = [UIImage imageNamed:@"personal_img_address.png"];
            break;
        default:
            break;
    }
    
    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    switch (indexPath.row) {
        case 0:{
            //我的积分
                MyScoreViewController *help = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"MyScoreViewController"];
                [self.navigationController pushViewController:help animated:YES];
        }
            break;
        case 1:{
            //个人信息
            PersonalInfoViewController *help = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"PersonalInfoViewController"];
            [self.navigationController pushViewController:help animated:YES];
        }
            break;
        case 2:{
            //我的订单
            MyOrderViewController *help = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"MyOrderViewController"];
            [self.navigationController pushViewController:help animated:YES];
        }

            break;
        case 3:{
            //我的关注
            FavouriteViewController *favourite = [[FavouriteViewController alloc] initWithNibName:@"FavouriteViewController" bundle:nil];
            [self.navigationController pushViewController:favourite animated:YES];
        }
            break;
        case 4:{
            //收货地址
            RcvAdressViewController *help = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"RcvAdressViewController"];
            [self.navigationController pushViewController:help animated:YES];
        }
            break;
        default:
            break;
    }
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
